import { NavigationContainer } from '@react-navigation/native';
import RootNavigator from './src/Navigators/RootNavigator';
import LoginNavigator from './src/Navigators/LoginNavigator';
import { useMappedState } from 'redux-react-hook';
import './src/i18n';
import { initializeFCM } from './src/utils/FCMExample';
import { useEffect } from 'react';
// 根组件，包含Redux Provider
function App() {
  const { isLogin } = useMappedState(state => ({ isLogin: state.isLogin }));
  console.log('isLogin', isLogin);
  useEffect(() => {
    initializeFCM();
  }, [1]);
  return (
      <NavigationContainer>
        {isLogin ? <RootNavigator /> : <LoginNavigator />}
      </NavigationContainer>
  );
}

export default App;
